/*
 *
 * Created on: 23.09.2012
 *
 * main.cpp
 * This file is part of KOBUS
 * 
 * Copyright (C) 2012 - Ivan Penkin, MIPT
 * grek.penkin@gmail.com
 *
 * KOBUS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * KOBUS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with KOBUS; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, 
 * Boston, MA  02110-1301  USA
 *  
 */

#include <KobusCommon.h>
#include <test.h>
#include <QtCore>

using namespace kobus;

int main() {

  QByteArray ar;
  QDataStream stream(&ar, QIODevice::ReadWrite);

  {
    TestSerialize s1;
    TestSerialize s2;

    s1.setName("s1");
    s1.setInt(1);

    s2.setName("s2");
    s2.setInt(2);

    qDebug() << s1.getName() << s1.getInt();
    qDebug() << s2.getName() << s2.getInt();

    stream << s1 << s2;
    stream.device() -> seek(0);
  }

  TestSerialize s1;
  TestSerialize s2;

  stream >> s2 >> s1;


  qDebug() << s1.getName() << s1.getInt();
  qDebug() << s2.getName() << s2.getInt();

  return 0;
}


